#ifndef DRIVER_H
#define DRIVER_H

#include <inttypes.h>

#define SUBADR1 0x2
#define SUBADR2 0x3
#define SUBADR3 0x4

#define MODE1 0x0
#define PRESCALE 0xFE

#define LED0_ON_L 0x6
#define LED0_ON_H 0x7
#define LED0_OFF_L 0x8
#define LED0_OFF_H 0x9

class Driver
{
public:
	Driver(uint8_t address = 0x5f);

	void begin(void);
	void reset(void);
	void setFreq(float freq);
	void setLevel(uint8_t num, uint16_t on, uint16_t off);

private:
	uint8_t m_address;

	uint8_t read8(uint8_t addr);
	void write8(uint8_t addr, uint8_t d);
};

#endif
